using System.IO;

namespace Kopernikus.Parsing.AST
{
    public abstract class ASTNode
    {
        public abstract IConvertToSymbol Token { get; }
        public abstract Symbol Symbol { get; }

        public abstract int ChildCount { get; }

        public abstract ASTNode this[int index] { get; }

        public override string ToString()
        {
            StringWriter writer = new StringWriter();
            PrettyPrint(writer, 0);
            return writer.ToString();
        }

        public abstract void PrettyPrint(TextWriter writer, int level);
    }
}